package yunquan.wang.modules.customer.entity;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.MapsId;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;

import yunquan.wang.base.domain.AuditableEntity;
import yunquan.wang.modules.base.entity.UserBasic;

/**
 * 客户基本信息
 * 
 * @author wang
 * 
 */
@Entity
@Table(name = "C_CONTACTS")
public class Contacts extends AuditableEntity {
	
 
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "contacts")
	private List<ContactsVisitInfo> contactsVistInfos = new ArrayList<ContactsVisitInfo>();
	@OneToOne(fetch=FetchType.LAZY)
	@MapsId
	private ContactsInfo contactsInfo;
	
	@ManyToOne
	@JoinColumn(name = "PK_CUSTOMER")
	private Customer customer;

	// 业务交易记录
	/**
	 * 
	 */
	private static final long serialVersionUID = 4318858994447191848L;

	public Customer getCustomer() {
		return customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	/**
	 * 客户号
	 */
	private String customerNo;
	/**
	 * 姓名
	 */
	@Min(1)
	@Max(50)
	private String name;
	/**
	 * 职位
	 */
	private String pisition;
	/**
	 * 年龄
	 */
	private Integer age;

	/**
	 * 婚姻状况，0，单身，1，已婚，2，离异，3，丧偶
	 */
	private Integer marray;
	/**
	 * 移动电话
	 */
	private String mophone;
	/**
	 * 工作电话
	 */
	private String workPhone;
	/**
	 * 家庭电话
	 */
	private String homePhone;

	/**
	 * 单位地址
	 */
	private String workAddress;

	/**
	 * 家庭地址
	 */
	private String homeAddress;
	/**
	 * 性别
	 */
	private Boolean sex;
	/**
	 * 电子邮件
	 */
	private String email;

	/**
	 * 跟进人
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PK_FOLLOWUSER")
	private UserBasic followUpUser;

	/**
	 * 使用状态,
	 */
	 
	private Boolean status;

 
	public List<ContactsVisitInfo> getContactsVistInfos() {
		return contactsVistInfos;
	}

	public void setContactsVistInfos(List<ContactsVisitInfo> contactsVistInfos) {
		this.contactsVistInfos = contactsVistInfos;
	}

	public ContactsInfo getContactsInfo() {
		return contactsInfo;
	}

	public void setContactsInfo(ContactsInfo contactsInfo) {
		this.contactsInfo = contactsInfo;
	}

	public String getCustomerNo() {
		return customerNo;
	}

	public void setCustomerNo(String customerNo) {
		this.customerNo = customerNo;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPisition() {
		return pisition;
	}

	public void setPisition(String pisition) {
		this.pisition = pisition;
	}

	public Integer getAge() {
		return age;
	}

	public void setAge(Integer age) {
		this.age = age;
	}

	public Integer getMarray() {
		return marray;
	}

	public void setMarray(Integer marray) {
		this.marray = marray;
	}

	public String getMophone() {
		return mophone;
	}

	public void setMophone(String mophone) {
		this.mophone = mophone;
	}

	public String getWorkPhone() {
		return workPhone;
	}

	public void setWorkPhone(String workPhone) {
		this.workPhone = workPhone;
	}

	public String getHomePhone() {
		return homePhone;
	}

	public void setHomePhone(String homePhone) {
		this.homePhone = homePhone;
	}

	public String getWorkAddress() {
		return workAddress;
	}

	public void setWorkAddress(String workAddress) {
		this.workAddress = workAddress;
	}

	public String getHomeAddress() {
		return homeAddress;
	}

	public void setHomeAddress(String homeAddress) {
		this.homeAddress = homeAddress;
	}

	public Boolean getSex() {
		return sex;
	}

	public void setSex(Boolean sex) {
		this.sex = sex;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public UserBasic getFollowUpUser() {
		return followUpUser;
	}

	public void setFollowUpUser(UserBasic followUpUser) {
		this.followUpUser = followUpUser;
	}

	public Boolean getStatus() {
		return status;
	}

	public void setStatus(Boolean status) {
		this.status = status;
	}

}
